﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MiniKsiegowosc.Ustawienia
{
    public partial class FormKontrachenci : ProgNetAppBlocks.Forms.ProgNetSpreadSheetForm
    {
        public FormKontrachenci()
        {
            InitializeComponent();
        }

        protected override ProgNetAppBlocks.Forms.ProgNetRecordForm GetRecordForm(object record)
        {
            return null;
        }

        protected override bool AllowOpen
        {
            get { return false; }
        }

        protected override void FinishEdit()
        {
            base.FinishEdit();
            DataRow[] rows = kontrachenciDataSet.STP_KONTRACHENCI.Select(null, null, DataViewRowState.ModifiedCurrent | DataViewRowState.Added);
            foreach (DataRow r in rows)
            {
                int nip = r["STP_KON_NIP"].AsString().XReplace("[^0-9]+", "").AsInt();
                r.SetColumnValue("STP_KON_NIP_NUM", nip);
            }
        }
        protected override void ValidateAll()
        {
            
        }
    }
}
